package org.hk.kg.finance.fee.action;

import java.util.List;
import java.util.HashMap;
import java.util.Map;

import org.hk.kg.TraceObject;
import org.hk.kg.db.DBServiceProxy;
import org.hk.kg.finance.student.service.IStudentService;
import org.hk.kg.finance.student.service.StudentService;
import org.hk.kg.ui.ParamsStack;
import org.hk.kg.web.BaseAction;

public class FeeStuAction extends BaseAction{
	protected IStudentService studentService = DBServiceProxy.getProxyClz(StudentService.class);
	public String getStudents()
	{
		StringBuffer rlt = new StringBuffer();
		Map qryMap = new HashMap();
		qryMap.put("stuClz", this.getParams().get("clzId"));
		List<Map> students = studentService.queryStudents(qryMap);
		for(Map student : students)
		{
			rlt.append("<tr>")
					.append("<td>")
						.append("<a href=\"#turn2FeeDetail?stuId=")
							.append(student.get("stuId"))
						.append("\">")
							.append(student.get("stuId"))
						.append("</a>")
					.append("</td>")
					.append("<td>")
						.append(student.get("stuName"))
					.append("</td>")
					.append("<td>")
						.append(student.get("typeName"))
					.append("</td>")
				.append("</tr>");
		}
		return rlt.toString();
	}
	
	public TraceObject turn2FeeDetail(ParamsStack params)
	{
		TraceObject rlt = new TraceObject("fee_detail");
		rlt.addParam("stuId", params.getValue("stuId"));
		return rlt;
	}
}
